<?php
include "connect.php";
$now=date("Y-m-d");
//echo "$now";
$sql_ngay="select count(*) from counter where date='$now'";
//echo "$sql_ngay<hr>";
$kq_ngay=mysql_query($sql_ngay);
$r_ngay=mysql_fetch_array($kq_ngay);
$n_ngay=$r_ngay[0];
if($n_ngay==0){
	$count_ngay=1;
	$query_ngay="insert into counter(counter,date) values($count_ngay,'$now')";
//	echo "query: $query_ngay<hr>";
	$kq_q_ngay=mysql_query($query_ngay);
}
?>

<table width="195" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="195" height="35" background="images/bgn_counter2.png"><div align="left" style="color:#000000; font-family:Tahoma; font-size: 14px; padding-left:30px">SỐ LƯỢT TRUY CẬP</div></td>
  </tr>
  <tr>
        <td background="images/toplist-content.gif" style="border-left: 1px solid #CCCCCC;border-right: 1px solid #CCCCCC; background-repeat:repeat-x"> 
    <div style="line-height:20px">    
    <div style="padding-left:5px;padding-top:3px;">&raquo; Tổng số lượt truy cập</div>
	<div align="center" style="border-bottom:1px solid #CCC; padding-bottom:10px;"><img src="hitcounter/sum.php"/></div>
	</div>   
    </td>   
  </tr>
</table>
